/**
 * 文章请求模块
 */
import request from '@/utils/request'

/**
 * 获取文章列表
 */
export const getArticles_api = params => {
  return request({
    method: 'GET',
    url: '/app/v1_0/articles/'+params,
    // params 选项用来配置 Query 参数
    //params
  })
}


//   关注
export const followings_api = params => {
  return request({
    method: 'POST',
    url: `/app/v1_0/user/followings`,
    data:params
  })
}
//  取消关注用户
export const followingsDel_api = params => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/user/followings/`+params,
  })
}


/**
 * 收藏文章
 */
export const addCollect_api = target => {
  return request({
    method: 'POST',
    url: '/app/v1_0/article/collections',
    data: {
      target
    }
  })
}

/**
 * 取消收藏文章
 */
export const deleteCollect_api = target => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/article/collections/${target}`
  })
}


/**
 * 点赞文章
 */
export const addLike_api = target => {
  return request({
    method: 'POST',
    url: '/app/v1_0/article/likings',
    data: {
      target
    }
  })
}

/**
 * 取消点赞文章
 */
export const deleteLike_api = target => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/article/likings/${target}`
  })
}